# Switch NX2 - read when the Lichii GUI starts.
# One NAME=VALUE per line. Lines starting with # are ignored.
# A variable already set in the environment wins over this file.
# Between files, the user copy (%APPDATA%\eden\nx2_switches.txt, or
# $XDG_CONFIG_HOME/eden/nx2_switches.txt) wins over this one, so editing this file is never
# needed: copy the lines you want into your own and restart.
#
# Restart the emulator after editing.

# --- Performance tuning defaults for Switch 2 ---
# Offload GPU method/macro execution to the back thread (SPLIT=2 delivers up to +54% FPS alone).
EDEN_NX2_SPLIT=2

# Batch GPU fence syncpoints to reduce host driver overhead and smooth frametimes.
EDEN_NX2_FENCE_BATCH=1

# Leave buffer downloads disabled on Switch 2 (default): forcing downloads (=1) copies back
# 90-220 MB/s of buffers CPU never touches, causing heavy mutex contention and dropping FPS by ~38-63%.
EDEN_NX2_BUFFER_DOWNLOADS=1

# Paces frame submission 2 frames ahead. Reduces frametime spikes, but adds ~1-2 frames of input latency.
# Enable only if frame pacing stability is preferred over responsive controls.
#EDEN_NX2_FRAMES_AHEAD=2

# --- Workarounds / Debug ---
# Terrain/indirect drawing fix for Donkey Kong Bananza: enabled by default. Set to 0 only to leave to GPU.
#EDEN_NX2_RESETFIX=0

# Drop reactive-flushing read traps on Switch 2 programs (opt-in; can reduce FPS from 29 to 24 in MKW).
#EDEN_NX2_NO_REACTIVE=1

#EDEN_NX2_MME_JIT=0
#EDEN_NX2_PBFLUSH=0
#EDEN_NX2_SKIP_SAME=0
#EDEN_NX2_INLINE_DEFER=0
#EDEN_NX2_SPLIT_SKIP=1
#EDEN_NX2_AUTO_STUB=1
#EDEN_NX2_KEEP_ASTC=1

# Test 11: frame skip. When a frame comes late, the next frame's draws are dropped and it is
# not shown, so the game keeps closer to full speed. The number is the most frames skipped in a
# row (1-4); 0 or a # in front turns it off.
EDEN_NX2_FRAMESKIP=0
# GPU thread time breakdown in the log every 10 s (diagnostics only).
#EDEN_NX2_GPU_PROFILE=1
# Test 8's background shader building stays off, as in test 7.
EDEN_NX2_ASYNC_SKIP=0

# Test 12: the timer thread sleeps through long waits instead of holding a CPU thread
# (EDEN_TIMING_COARSE=0 goes back to the precise wait).
EDEN_TIMING_COARSE=1
# Test 13: the timer thread is woken only when a new event comes first (EDEN_TIMING_WAKE_ALL=1 wakes
# it for every event, as before). The log lists the busiest timer events every 10 s.
# Test 14: Donkey Kong Bananza gets the frame interval it asks for on every frame (constant game
# speed). EDEN_NX2_SWAP_FOLLOW=1 does it for every game, =0 for none.

# zelda 9 check: render passes of one frame saved as images once capture.now appears in the folder.
EDEN_NX2_FRAME_DUMP=J:\oot_frame_dump_12
EDEN_NX2_FRAME_DUMP_AT=file
# zelda 9 diag: textures each pass samples, and every native shader saved for analysis.
EDEN_NX2_FRAME_DUMP_SAMPLED=1
# diag3: no size cap trouble (4 GiB), blend state per pass.
EDEN_NX2_FRAME_DUMP_CAP_MIB=4096
# downloads test: GPU-written buffers copied back to game memory at every fence.
